<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE Safe #-}</span><span>
</span><span id="line-2"></span><span>
</span><span id="line-3"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-4"></span><span class="hs-comment">-- |</span><span>
</span><span id="line-5"></span><span class="hs-comment">-- Module      :  Text.ParserCombinators.Parsec.Expr</span><span>
</span><span id="line-6"></span><span class="hs-comment">-- Copyright   :  (c) Paolo Martini 2007</span><span>
</span><span id="line-7"></span><span class="hs-comment">-- License     :  BSD-style (see the LICENSE file)</span><span>
</span><span id="line-8"></span><span class="hs-comment">--</span><span>
</span><span id="line-9"></span><span class="hs-comment">-- Maintainer  :  derek.a.elkins@gmail.com</span><span>
</span><span id="line-10"></span><span class="hs-comment">-- Stability   :  provisional</span><span>
</span><span id="line-11"></span><span class="hs-comment">-- Portability :  portable</span><span>
</span><span id="line-12"></span><span class="hs-comment">--</span><span>
</span><span id="line-13"></span><span class="hs-comment">-- Parsec compatibility module</span><span>
</span><span id="line-14"></span><span class="hs-comment">--</span><span>
</span><span id="line-15"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-16"></span><span>
</span><span id="line-17"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">Text.ParserCombinators.Parsec.Expr</span><span>
</span><span id="line-18"></span><span>    </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="Text.Parsec.Expr.html#Assoc"><span class="hs-identifier">Assoc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.Parsec.Expr.html#AssocNone"><span class="hs-identifier">AssocNone</span></a></span><span class="hs-special">,</span><span class="annot"><a href="Text.Parsec.Expr.html#AssocLeft"><span class="hs-identifier">AssocLeft</span></a></span><span class="hs-special">,</span><span class="annot"><a href="Text.Parsec.Expr.html#AssocRight"><span class="hs-identifier">AssocRight</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-19"></span><span>      </span><span class="annot"><a href="Text.ParserCombinators.Parsec.Expr.html#Operator"><span class="hs-identifier">Operator</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-20"></span><span>      </span><span class="annot"><a href="Text.ParserCombinators.Parsec.Expr.html#OperatorTable"><span class="hs-identifier">OperatorTable</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-21"></span><span>      </span><span class="annot"><a href="Text.ParserCombinators.Parsec.Expr.html#buildExpressionParser"><span class="hs-identifier">buildExpressionParser</span></a></span><span>
</span><span id="line-22"></span><span>    </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-23"></span><span>
</span><span id="line-24"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Text.Parsec.Expr.html"><span class="hs-identifier">Text.Parsec.Expr</span></a></span><span class="hs-special">(</span><span class="annot"><a href="Text.Parsec.Expr.html#Assoc"><span class="hs-identifier">Assoc</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-25"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="Text.Parsec.Expr.html"><span class="hs-identifier">Text.Parsec.Expr</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">N</span></span><span>
</span><span id="line-26"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Text.ParserCombinators.Parsec.html"><span class="hs-identifier">Text.ParserCombinators.Parsec</span></a></span><span class="hs-special">(</span><span class="annot"><a href="Text.Parsec.String.html#GenParser"><span class="hs-identifier">GenParser</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-27"></span><span>
</span><span id="line-28"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../mtl/src/Control.Monad.Identity.html#"><span class="hs-identifier">Control.Monad.Identity</span></a></span><span>
</span><span id="line-29"></span><span>
</span><span id="line-30"></span><span class="hs-keyword">data</span><span> </span><span id="Operator"><span class="annot"><a href="Text.ParserCombinators.Parsec.Expr.html#Operator"><span class="hs-identifier hs-var">Operator</span></a></span></span><span> </span><span id="local-6989586621679062690"><span class="annot"><a href="#local-6989586621679062690"><span class="hs-identifier hs-type">tok</span></a></span></span><span> </span><span id="local-6989586621679062689"><span class="annot"><a href="#local-6989586621679062689"><span class="hs-identifier hs-type">st</span></a></span></span><span> </span><span id="local-6989586621679062688"><span class="annot"><a href="#local-6989586621679062688"><span class="hs-identifier hs-type">a</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span id="Infix"><span class="annot"><a href="Text.ParserCombinators.Parsec.Expr.html#Infix"><span class="hs-identifier hs-var">Infix</span></a></span></span><span>  </span><span class="hs-special">(</span><span class="annot"><a href="Text.Parsec.String.html#GenParser"><span class="hs-identifier hs-type">GenParser</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679062690"><span class="hs-identifier hs-type">tok</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679062689"><span class="hs-identifier hs-type">st</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679062688"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679062688"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679062688"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><a href="Text.Parsec.Expr.html#Assoc"><span class="hs-identifier hs-type">Assoc</span></a></span><span>
</span><span id="line-31"></span><span>                         </span><span class="hs-glyph">|</span><span> </span><span id="Prefix"><span class="annot"><a href="Text.ParserCombinators.Parsec.Expr.html#Prefix"><span class="hs-identifier hs-var">Prefix</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.Parsec.String.html#GenParser"><span class="hs-identifier hs-type">GenParser</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679062690"><span class="hs-identifier hs-type">tok</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679062689"><span class="hs-identifier hs-type">st</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679062688"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679062688"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-32"></span><span>                         </span><span class="hs-glyph">|</span><span> </span><span id="Postfix"><span class="annot"><a href="Text.ParserCombinators.Parsec.Expr.html#Postfix"><span class="hs-identifier hs-var">Postfix</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.Parsec.String.html#GenParser"><span class="hs-identifier hs-type">GenParser</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679062690"><span class="hs-identifier hs-type">tok</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679062689"><span class="hs-identifier hs-type">st</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679062688"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679062688"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-33"></span><span>
</span><span id="line-34"></span><span class="hs-keyword">type</span><span> </span><span id="OperatorTable"><span class="annot"><a href="Text.ParserCombinators.Parsec.Expr.html#OperatorTable"><span class="hs-identifier hs-var">OperatorTable</span></a></span></span><span> </span><span id="local-6989586621679062684"><span class="annot"><a href="#local-6989586621679062684"><span class="hs-identifier hs-type">tok</span></a></span></span><span> </span><span id="local-6989586621679062683"><span class="annot"><a href="#local-6989586621679062683"><span class="hs-identifier hs-type">st</span></a></span></span><span> </span><span id="local-6989586621679062682"><span class="annot"><a href="#local-6989586621679062682"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">[</span><span class="annot"><a href="Text.ParserCombinators.Parsec.Expr.html#Operator"><span class="hs-identifier hs-type">Operator</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679062684"><span class="hs-identifier hs-type">tok</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679062683"><span class="hs-identifier hs-type">st</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679062682"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span><span class="hs-special">]</span><span>
</span><span id="line-35"></span><span>
</span><span id="line-36"></span><span id="local-6989586621679062729"><span id="local-6989586621679062730"><span id="local-6989586621679062731"><span class="annot"><a href="Text.ParserCombinators.Parsec.Expr.html#convert"><span class="hs-identifier hs-type">convert</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.ParserCombinators.Parsec.Expr.html#Operator"><span class="hs-identifier hs-type">Operator</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679062731"><span class="hs-identifier hs-type">tok</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679062730"><span class="hs-identifier hs-type">st</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679062729"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.Expr.html#Operator"><span class="hs-identifier hs-type">N.Operator</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679062731"><span class="hs-identifier hs-type">tok</span></a></span><span class="hs-special">]</span><span> </span><span class="annot"><a href="#local-6989586621679062730"><span class="hs-identifier hs-type">st</span></a></span><span> </span><span class="annot"><a href="../../base/src/Data.Functor.Identity.html#Identity"><span class="hs-identifier hs-type">Identity</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679062729"><span class="hs-identifier hs-type">a</span></a></span></span></span></span><span>
</span><span id="line-37"></span><span id="convert"><span class="annot"><span class="annottext">convert :: forall tok st a. Operator tok st a -&gt; Operator [tok] st Identity a
</span><a href="Text.ParserCombinators.Parsec.Expr.html#convert"><span class="hs-identifier hs-var hs-var">convert</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.ParserCombinators.Parsec.Expr.html#Infix"><span class="hs-identifier hs-type">Infix</span></a></span><span> </span><span id="local-6989586621679062680"><span class="annot"><span class="annottext">GenParser tok st (a -&gt; a -&gt; a)
</span><a href="#local-6989586621679062680"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span id="local-6989586621679062679"><span class="annot"><span class="annottext">Assoc
</span><a href="#local-6989586621679062679"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">GenParser tok st (a -&gt; a -&gt; a)
-&gt; Assoc -&gt; Operator [tok] st Identity a
forall s u (m :: * -&gt; *) a.
ParsecT s u m (a -&gt; a -&gt; a) -&gt; Assoc -&gt; Operator s u m a
</span><a href="Text.Parsec.Expr.html#Infix"><span class="hs-identifier hs-var">N.Infix</span></a></span><span> </span><span class="annot"><span class="annottext">GenParser tok st (a -&gt; a -&gt; a)
</span><a href="#local-6989586621679062680"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">Assoc
</span><a href="#local-6989586621679062679"><span class="hs-identifier hs-var">a</span></a></span><span>
</span><span id="line-38"></span><span class="annot"><a href="Text.ParserCombinators.Parsec.Expr.html#convert"><span class="hs-identifier hs-var">convert</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.ParserCombinators.Parsec.Expr.html#Prefix"><span class="hs-identifier hs-type">Prefix</span></a></span><span> </span><span id="local-6989586621679062677"><span class="annot"><span class="annottext">GenParser tok st (a -&gt; a)
</span><a href="#local-6989586621679062677"><span class="hs-identifier hs-var">p</span></a></span></span><span class="hs-special">)</span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">GenParser tok st (a -&gt; a) -&gt; Operator [tok] st Identity a
forall s u (m :: * -&gt; *) a.
ParsecT s u m (a -&gt; a) -&gt; Operator s u m a
</span><a href="Text.Parsec.Expr.html#Prefix"><span class="hs-identifier hs-var">N.Prefix</span></a></span><span> </span><span class="annot"><span class="annottext">GenParser tok st (a -&gt; a)
</span><a href="#local-6989586621679062677"><span class="hs-identifier hs-var">p</span></a></span><span>
</span><span id="line-39"></span><span class="annot"><a href="Text.ParserCombinators.Parsec.Expr.html#convert"><span class="hs-identifier hs-var">convert</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.ParserCombinators.Parsec.Expr.html#Postfix"><span class="hs-identifier hs-type">Postfix</span></a></span><span> </span><span id="local-6989586621679062675"><span class="annot"><span class="annottext">GenParser tok st (a -&gt; a)
</span><a href="#local-6989586621679062675"><span class="hs-identifier hs-var">p</span></a></span></span><span class="hs-special">)</span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">GenParser tok st (a -&gt; a) -&gt; Operator [tok] st Identity a
forall s u (m :: * -&gt; *) a.
ParsecT s u m (a -&gt; a) -&gt; Operator s u m a
</span><a href="Text.Parsec.Expr.html#Postfix"><span class="hs-identifier hs-var">N.Postfix</span></a></span><span> </span><span class="annot"><span class="annottext">GenParser tok st (a -&gt; a)
</span><a href="#local-6989586621679062675"><span class="hs-identifier hs-var">p</span></a></span><span>
</span><span id="line-40"></span><span>
</span><span id="line-41"></span><span id="local-6989586621679062713"><span id="local-6989586621679062714"><span id="local-6989586621679062715"><span class="annot"><a href="Text.ParserCombinators.Parsec.Expr.html#buildExpressionParser"><span class="hs-identifier hs-type">buildExpressionParser</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.ParserCombinators.Parsec.Expr.html#OperatorTable"><span class="hs-identifier hs-type">OperatorTable</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679062715"><span class="hs-identifier hs-type">tok</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679062714"><span class="hs-identifier hs-type">st</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679062713"><span class="hs-identifier hs-type">a</span></a></span><span>
</span><span id="line-42"></span><span>                      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.String.html#GenParser"><span class="hs-identifier hs-type">GenParser</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679062715"><span class="hs-identifier hs-type">tok</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679062714"><span class="hs-identifier hs-type">st</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679062713"><span class="hs-identifier hs-type">a</span></a></span><span>
</span><span id="line-43"></span><span>                      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.Parsec.String.html#GenParser"><span class="hs-identifier hs-type">GenParser</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679062715"><span class="hs-identifier hs-type">tok</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679062714"><span class="hs-identifier hs-type">st</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679062713"><span class="hs-identifier hs-type">a</span></a></span></span></span></span><span>
</span><span id="line-44"></span><span id="buildExpressionParser"><span class="annot"><span class="annottext">buildExpressionParser :: forall tok st a.
OperatorTable tok st a -&gt; GenParser tok st a -&gt; GenParser tok st a
</span><a href="Text.ParserCombinators.Parsec.Expr.html#buildExpressionParser"><span class="hs-identifier hs-var hs-var">buildExpressionParser</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">OperatorTable [tok] st Identity a
-&gt; ParsecT [tok] st Identity a -&gt; ParsecT [tok] st Identity a
forall s (m :: * -&gt; *) t u a.
Stream s m t =&gt;
OperatorTable s u m a -&gt; ParsecT s u m a -&gt; ParsecT s u m a
</span><a href="Text.Parsec.Expr.html#buildExpressionParser"><span class="hs-identifier hs-var">N.buildExpressionParser</span></a></span><span> </span><span class="annot"><span class="annottext">(OperatorTable [tok] st Identity a
 -&gt; ParsecT [tok] st Identity a -&gt; ParsecT [tok] st Identity a)
-&gt; ([[Operator tok st a]] -&gt; OperatorTable [tok] st Identity a)
-&gt; [[Operator tok st a]]
-&gt; ParsecT [tok] st Identity a
-&gt; ParsecT [tok] st Identity a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">([Operator tok st a] -&gt; [Operator [tok] st Identity a])
-&gt; [[Operator tok st a]] -&gt; OperatorTable [tok] st Identity a
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Operator tok st a -&gt; Operator [tok] st Identity a)
-&gt; [Operator tok st a] -&gt; [Operator [tok] st Identity a]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">Operator tok st a -&gt; Operator [tok] st Identity a
forall tok st a. Operator tok st a -&gt; Operator [tok] st Identity a
</span><a href="Text.ParserCombinators.Parsec.Expr.html#convert"><span class="hs-identifier hs-var">convert</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-45"></span></pre></body></html>